<template>
	<div>
		<div>
			<i class="el-icon-delete" @click="message()"></i>
		</div>
	</div>
</template>

<script>
  import {deleteCategory} from '@/api/admin/category.js'
	export default{
		data() {
			return {
			}
		},
		props: {
			row: {type: Object},
		},
		methods: {
			message(){
				this.$confirm('确认删除吗?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          let data = {id:this.row.id}
          deleteCategory(data).then(res => {
            if(res.code == 200){
              this.$message({
                type: 'success',
                message: '删除成功!'
              });
              this.$emit('flash')
            }
          })
        })
      }
		},
		created(){
		}
	}
</script>

<style scoped>
	i:hover{
		color: #409EFF;
	}
	i{
		font-size: 20px;
	}
</style>
